package com.engine.salary.entity.salaryitem.dto;

import com.engine.salary.annotation.SalaryTableColumn;
import com.engine.salary.annotation.TableTitle;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Harryxzy
 * @date 2023/06/01 17:05
 * @description 薪资账套薪资项目列表
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryItemSobListDTO {

    @JsonSerialize(using = ToStringSerializer.class)
    @SalaryTableColumn(column = "id", display = false)
    private Long id;

    @SalaryTableColumn(text = "名称", width = "10%", column = "name")
    @TableTitle(title = "名称",dataIndex = "name",key = "name")
    private String name;
    private String code;

    @SalaryTableColumn(text = "系统名", width = "10%", column = "systemName")
    @TableTitle(title = "系统名",dataIndex = "systemName",key = "systemName")
    private String systemName;

    //薪资档案引用
//    @SalaryTableColumn(text = "薪资档案引用", width = "10%", column = "useInEmployeeSalary")
//    @TableTitle(title = "薪资档案引用",dataIndex = "useInEmployeeSalary",key = "useInEmployeeSalary")
    private Integer useInEmployeeSalary;

    // 薪资项目类型
    @SalaryTableColumn(text = "项目类型", width = "10%", column = "salaryItemType")
    @TableTitle(title = "项目类型",dataIndex = "salaryItemType",key = "salaryItemType")
    private String salaryItemType;

    //默认使用
    @SalaryTableColumn(text = "默认使用", width = "10%", column = "useDefault")
    @TableTitle(title = "默认使用",dataIndex = "useDefault",key = "useDefault")
    private Integer useDefault;

    //核算时默认隐藏
    @SalaryTableColumn(text = "核算时隐藏", width = "10%", column = "hideDefault")
    @TableTitle(title = "核算时隐藏",dataIndex = "hideDefault",key = "hideDefault")
    private Integer hideDefault;

    //进位规则
    @SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingModeShowValue",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode")
    @TableTitle(title = "进位规则",dataIndex = "roundingModeShowValue",key = "roundingModeShowValue")
    private String roundingModeShowValue;

    private Integer roundingMode;


    //保留小数位
    @SalaryTableColumn(text = "保留小数位", width = "10%", column = "pattern")
    @TableTitle(title = "保留小数位",dataIndex = "pattern",key = "pattern")
    private Integer pattern;

    //取值方式
    @SalaryTableColumn(text = "取值方式", width = "10%", column = "valueTypeShowValue",transmethod = "com.engine.salary.transmethod.TransMethod.datasource")
    @TableTitle(title = "取值方式",dataIndex = "valueTypeShowValue",key = "valueTypeShowValue")
    private String valueTypeShowValue;

    private Integer valueType;

    /**
     * @see SalaryDataTypeEnum
     */
    @SalaryTableColumn(text = "字段类型", width = "10%", column = "dataTypeShowValue",transmethod = "com.engine.salary.transmethod.TransMethod.dataType")
    @TableTitle(title = "字段类型",dataIndex = "dataTypeShowValue",key = "dataTypeShowValue")
    private String dataTypeShowValue;

    private String dataType;

    //公式id
    private Long formulaId;

    //公式内容
    private String formulaContent;

    @SalaryTableColumn(text = "个税申报表对应字段", width = "10%", column = "taxDeclarationColumn")
    @TableTitle(title = "个税申报表对应字段",dataIndex = "taxDeclarationColumn",key = "taxDeclarationColumn")
    private String taxDeclarationColumn;

    // 用于前端展示 公式原始内容
    private String originFormulaContent;

    // 用于前端展示 原始sql
    private String originSqlContent;
    //备注
    @SalaryTableColumn(text = "备注", width = "10%", column = "description")
    @TableTitle(title = "备注",dataIndex = "description",key = "description")
    private String description;


    //是否可以编辑
    private Boolean canEdit;

    //是否可以删除
    private Boolean canDelete;

    //排序
    private Integer sortedIndex;

    // 默认值
    private String defaultValue;


    @SalaryTableColumn(text = "操作", width = "20%", column = "operate")
    private String operate;

}
